package com.xsl.culture.mybasevideoview.view;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;

import com.xsl.culture.R;
import com.xsl.culture.mybasevideoview.MainActivity;
import com.xsl.culture.mybasevideoview.utils.UiUtils;
import com.xsl.culture.mybasevideoview.utils.XslUtils;

import java.lang.ref.WeakReference;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class maskActivity extends Activity {

    @BindView(R.id.imageView)
    ImageView imageView;

    int pagerTag = 1;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_mask);
        XslUtils.hideStausbar(new WeakReference<>(this), true);
        ButterKnife.bind(this);

        switch (MainActivity.curLangugue){
            case LanguageActivity.chinese:
                imageView.setImageResource(R.mipmap.xinshou1jian);
                break;
            case LanguageActivity.cantonese:
                imageView.setImageResource(R.mipmap.xinshou1fan);
                break;
            case LanguageActivity.english:
                imageView.setImageResource(R.mipmap.xinshou1en);
                break;
        }
    }

    @OnClick({R.id.next,R.id.previous})
    void next(View view) {
        switch (view.getId()){
            case R.id.previous:
                if (pagerTag == 2) {
                    pagerTag--;
                    switch (MainActivity.curLangugue){
                        case LanguageActivity.chinese:
                            imageView.setImageResource(R.mipmap.xinshou1jian);
                            break;
                        case LanguageActivity.cantonese:
                            imageView.setImageResource(R.mipmap.xinshou1fan);
                            break;
                        case LanguageActivity.english:
                            imageView.setImageResource(R.mipmap.xinshou1en);
                            break;
                    }
                    //layoutView.setBackgroundResource(R.mipmap.mask_2);
                }
                break;
            case R.id.next:
                if (pagerTag == 1) {
                    pagerTag++;
                    switch (MainActivity.curLangugue){
                        case LanguageActivity.chinese:
                            imageView.setImageResource(R.mipmap.xinshou2jian);
                            break;
                        case LanguageActivity.cantonese:
                            imageView.setImageResource(R.mipmap.xinshou2fan);
                            break;
                        case LanguageActivity.english:
                            imageView.setImageResource(R.mipmap.xinshou2en);
                            break;
                    }
                }
                else if (pagerTag == 2) {
                    finish();
                }
//                else {
//                    finish();
//                }
                break;
        }

    }

    @Override
    protected void onResume() {
        super.onResume();
        UiUtils.hideBottomUIMenu(this);
    }
}
